package com.imdroid.modal;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import net.orange.architecture.model.BaseValueObject;

/**
 * the GPS location of devices
 * 
 */
@Entity
@Table(name = "b_location")
public class Location extends BaseValueObject {
	/**
	 * The generated serial version uuid.
	 */
	private static final long serialVersionUID = 4775377893675659411L;
	/**
	 * the device
	 */
	@ManyToOne(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER)
	@JoinColumn(name = "device_pk", insertable = true, updatable = true)
	private Device device;
	/**
	 * the date/time of the this record
	 */
	@Column(name = "pos_date")
	private Date pos_date;
	/**
	 * the GPS lat
	 */
	@Column(name = "pos_lat")
	private float pos_lat;
	/**
	 * the GPS lon
	 */
	@Column(name = "pos_lon")
	private float pos_lon;

	/**
	 * The start time of the period
	 */
	@Column(name = "start_time")
	private long start_time;

	/**
	 * @return the device
	 */
	public Device getDevice() {
		return device;
	}

	/**
	 * @param device
	 *            the device to set
	 */
	public void setDevice(Device device) {
		this.device = device;
	}

	/**
	 * @return the pos_date
	 */
	public Date getPos_date() {
		return pos_date;
	}

	/**
	 * @param pos_date
	 *            the pos_date to set
	 */
	public void setPos_date(Date pos_date) {
		this.pos_date = pos_date;
	}

	/**
	 * @return the pos_lat
	 */
	public float getPos_lat() {
		return pos_lat;
	}

	/**
	 * @param pos_lat
	 *            the pos_lat to set
	 */
	public void setPos_lat(float pos_lat) {
		this.pos_lat = pos_lat;
	}

	/**
	 * @return the pos_lon
	 */
	public float getPos_lon() {
		return pos_lon;
	}

	/**
	 * @param pos_lon
	 *            the pos_lon to set
	 */
	public void setPos_lon(float pos_lon) {
		this.pos_lon = pos_lon;
	}

	/**
	 * @return the start_time
	 */
	public long getStart_time() {
		return start_time;
	}

	/**
	 * @param start_time
	 *            the start_time to set
	 */
	public void setStart_time(long start_time) {
		this.start_time = start_time;
	}

}
